<template>
  <card ref="Card">
    <go-back @back="back" content="问题件详情"/>
    <el-form label-width="120px">
      <el-row>
        <el-col :span="10">
          <el-form-item label="订单号:">{{formData.number}}</el-form-item>
          <el-form-item label="寄件人姓名:">{{formData.senderName}}</el-form-item>
          <el-form-item label="收件人姓名:">{{formData.receiverName}}</el-form-item>
          <el-form-item label="当前网点:">{{operation.currentName}}</el-form-item>
        </el-col>
        <el-col :span="10">
          <el-form-item label="创建日期:">{{formData.updateTime | formatDateTime}}</el-form-item>
          <el-form-item label="寄件人联系电话:">{{formData.senderPhone}}</el-form-item>
          <el-form-item label="收件人联系电话:">{{formData.receiverPhone}}</el-form-item>
          <el-form-item label="问题描述:">{{operation.notes}}</el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-table :data="fundRecords" class="mb-20">
      <el-table-column prop="notes" label="处理说明"/>
      <el-table-column prop="createTime" label="处理日期">
        <template slot-scope="scope">
          <span>{{scope.row.createTime | formatDateTime}}</span>
        </template>
      </el-table-column>
    </el-table>
    <el-form v-if="feedBack && feedBack.content">
      <el-form-item label="申述内容:"/>
      <div v-html="feedBack.content"></div>
    </el-form>
  </card>
</template>

<script>
  import {getProblemOperationApi} from '@/api/fund'
  import {resetData} from "@/utils/common";

  export default {
    name: "Detail",
    props: {
      tab: {
        required: true,
        type: Boolean
      }
    },
    data() {
      return {
        id: null,
        formData: {},
        fundRecords: [],
        feedBack: {},
        operation: {}
      }
    },
    methods: {
      // 获取数据
      getData() {
        this.$refs.Card.start()
        getProblemOperationApi({id: this.id}).then(result => {
          let response = result.resultParam
          this.formData = response.expressOrder
          this.fundRecords = response.fundRecordsList
          this.feedBack = response.feedBack
          this.operation = response.operation
          this.$refs.Card.stop()
        })
      },
      // 返回
      back() {
        resetData(this)
        this.$emit('update:tab', !this.tab)
        this.$emit('update')
      }
    }
  }
</script>
